import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import login from '@/pages/login'
import regist from "@/pages/regist";
import user_center from "../pages/user_center";
import customer from "../pages/customer";
import items_details from "../pages/items_details";
import contact from "../pages/contact";
import seller_index from "../pages/seller_index";
import order from "../pages/order";
import order_purchase from "../pages/order_purchase";
import store_management from "../pages/store_management";
import pay_success from "../pages/pay_success";
import cart from "../pages/cart";
import homeee from "../pages/homeee";

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
    },
    {
      path: '/home',
      name: 'homee',
      component: homeee
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/regist',
      name: 'regist',
      component: regist
    },
    {
      path: '/user_center',
      name: 'user_center',
      component: user_center
    },
    {
      path: '/customer',
      name: 'customer',
      component: customer
    },
    {
      path: '/items_details',
      name: 'items_details',
      component: items_details
    },
    {
      path: '/order_purchase',
      name: 'order_purchase',
      component: order_purchase
    },
    {
      path: '/seller_index',
      name: 'seller_index',
      component: seller_index
    },
    {
      path: '/contact',
      name: 'contact',
      component: contact
    },
    {
      path: '/manage',
      name: 'manage',
      component: store_management,
    },
    {
      path: '/pay_success',
      name: 'pay_success',
      component:pay_success
    },
    {
      path: '/cart',
      name: 'cart',
      component:cart
    },
    {
      path: '/order',
      name: 'order',
      component: order,
    }
  ]
})
